import routes from './routes'

const title = '幻熊科技'

export default {
  history: 'hash',
  proxy: {
    '/api': {
      target: 'https://yc.weddingee.com',
      changeOrigin: true,
      onProxyRes(proxyRes) {
        /* eslint no-underscore-dangle: 0 */
        proxyRes.headers.target = proxyRes.client._host + proxyRes.client.parser.outgoing.path
      }
    },
  },
  routes,
  "define": {
    "process.env.APP_TITLE": 1,
  },
  plugins: [
    // ref: https://umijs.org/plugin/umi-plugin-react.html
    ['umi-plugin-react', {
      title,
      antd: true,
      dva: true,
      dynamicImport: {
        dynamicImport: {
          loadingComponent: './layouts/PageLoading/index',
        }
      },
      dll: true,
      pwa: true,
      routes: {
        exclude: [],
      },
      hardSource: true,
    }],
  ],
  theme: {
    // '@layout-body-background': '#383b3d', // 全局颜色
    'card-actions-background': '#f5f8fa',
    '@primary-color': '#FF5647',
    'menu-dark-bg': '#383b3d',
    'menu-dark-submenu-bg': '#2f3133',
    'layout-sider-background': '#383b3d',
    '@layout-header-background': '#383b3d'
  },
  ignoreMomentLocale: true,
  lessLoaderOptions: {
    javascriptEnabled: true,
  },
  browserslist: [
    "> 1%",
    "last 2 versions"
  ]
}
